package com.neulogistics.contrib.usercenter.domain.model.aggregate;

import com.neulogistics.contrib.usercenter.domain.model.enumeration.UserRole;
import com.neulogistics.contrib.usercenter.domain.model.enumeration.UserStatus;
import com.neulogistics.infrastructure.ddd.domain.seedwork.Entity;
import com.neulogistics.infrastructure.ddd.domain.seedwork.IAggregateRoot;
import lombok.Data;

import java.util.Date;

@Data
public class User extends Entity<Integer> implements IAggregateRoot {
    /**
     * 用户id
     */
    private Integer userId;

    /**
     * 用户名
     */
    private String username;

    /**
     * 密码
     */
    private String password;

    /**
     * 用户性别：0:男；1:女
     */
    private Integer userGender;

    /**
     * 身份证号码
     */
    private String userIdentity;

    /**
     * 用户电话
     */
    private String userPhone;

    /**
     * 姓名
     */
    private String name;

    /**
     * 用户头像
     */
    private String userAvatar;

    /**
     * 部门ID
     */
    private Integer departmentId;

    /**
     * 部门名称
     */
    private String departmentName;

    /**
     * 创建时间
     */
    private Date createTime;

    /**
     * 更新时间
     */
    private Date updateTime;

    /**
     * 用户角色：0：管理员 1:客服中心 2:调度中心 3:中心库房  4: 分站库房 5: 分站 6: 配送中心 7:财务部 8:配送员
     */
    private UserRole userRole;

    /**
     * 用户状态： 0:禁用；1:开启
     */
    private UserStatus userStatus;

    /**
     * 是否删除
     */
    private Integer deleted;

    public User(String username, Integer userGender, String userIdentity, String userPhone, String name,
                Integer departmentId, String userAvatar, String departmentName, UserRole userRole) {
        this.username = username;
        this.userGender = userGender;
        this.userIdentity = userIdentity;
        this.userPhone = userPhone;
        this.name = name;
        this.departmentId = departmentId;
        this.userAvatar = userAvatar;
        this.departmentName = departmentName;
        this.userRole = userRole;
        this.userStatus = UserStatus.Enable;
    }

    public User() {
    }
}
